<template>
  <base-option :selected="selected" :field-config="fieldConfig" :form-config="formConfig">
    <template #default="{ hideOptions }">
      <el-form-item v-if="fieldConfig.defaultValue !== undefined && hideOptions('defaultValue')" label="默认值">
        <el-time-picker
          v-model="fieldConfig.defaultValue"
          :format="fieldConfig.format || 'HH:mm:ss'"
          value-format="HH:mm:ss"
        />
      </el-form-item>
      <el-form-item v-if="fieldConfig.format !== undefined && hideOptions('format')" label="时间格式">
        <el-input v-model="fieldConfig.format" placeholder="如：HH时mm分" />
      </el-form-item>
    </template>
  </base-option>
</template>

<script setup>
import { toRefs } from 'vue'
import baseOption from './base-option.vue'
import propsDefinition from './props'
const props = defineProps(propsDefinition)
const { selected, fieldConfig, formConfig } = toRefs(props)
</script>
